home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!scisun!sergio
- From: sergio@sci.ccny.cuny.edu (Sergio Rojas)
- Subject: What is wrong in this code?
- Message-ID: <DL2z7o.2K5@scisun.sci.ccny.cuny.edu>
- Sender: usenet@scisun.sci.ccny.cuny.edu
- Organization: City College Of New York - Science
- X-Newsreader: TIN [version 1.2 PL2]
- Date: Fri, 12 Jan 1996 18:26:12 GMT
-
- Hello Fellows,
-
- I am traying to be literate in C and here is a
- problem wich I have been unable to detect:
-
- #include <stdio.h>
- #include <math.h>
- main()
- {
- double x;
-
- printf("\n Enter a number \n");
-
- scanf("%f", &x);
-
- printf("\n %e to the power %e is equal to ", x , x );
-
- x = pow(x,x);
-
- printf(" %12.6f \n", x );
-
- }
-
- Some output are as follows:
-
- Enter a number
- 2
-
- 2.000000e+00 to the power 2.000000e+00 is equal to 4.000000
- scisun{sergio}121% a.out
-
- Enter a number
- 3
-
- 3.200000e+01 to the power 3.200000e+01 is equal to 1461501637330902918203684832716283019655932542976.000000
-
-
- Thanks for your comments,
-
- rojas
- Email: sergio@scisun.sci.ccny.cuny.edu
-
-